package com.sise.controller.wechat;

import com.sise.entity.ProductInfo;
import com.sise.recomder.BrowseRecordRecomder;
import com.sise.recomder.CollectRecomder;
import com.sise.recomder.LikeRecomder;
import com.sise.recomder.PurchaseRecomder;
import com.sise.service.IRatingService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zj
 */
@RestController
@RequestMapping("/sise/wechat/recomder")
public class WechatRecomderController {

    @Resource
    private LikeRecomder likeRecomder;

    @Resource
    private IRatingService iRatingService;

    @Resource
    private CollectRecomder collectRecomder;

    @Resource
    private PurchaseRecomder purchaseRecomder;

    @Resource
    private BrowseRecordRecomder browseRecordRecomder;

    @RequestMapping("/getCollectRecomder")
    public List<ProductInfo> getCollectRecomder(String openId) {
        return collectRecomder.recommend(openId);
    }

    @RequestMapping("/getPurchaseRecomder")
    public List<ProductInfo> getPurchaseRecomder(String openId) {
        return purchaseRecomder.recommend(openId);
    }

    @RequestMapping("/getLikeRecomder")
    public List<ProductInfo> getLikeRecomder(String openId) {
        return likeRecomder.recommend(openId);
    }

    @RequestMapping("/getBrowseRecord")
    public List<ProductInfo> getBrowseRecord(String openId) {
        return browseRecordRecomder.recommend(openId);
    }

    @RequestMapping("/getRatingRecomder")
    public List<ProductInfo> getRatingRecomder(String openId) {
        return iRatingService.recommend(openId);
    }
}
